﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="demoTextBox.aspx.cs" Inherits="TextBox_demoTextBox" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="screen.css" rel="stylesheet" type="text/css" />
    <script src="scripts/jquery-1.7.1.js" type="text/javascript"></script>
    <script src="scripts/jquery.watermarkinput.js" type="text/javascript"></script>

    <%--限定允許輸入正負整數、浮點--%>
    <script src="scripts/jquery.numeric.js" type="text/javascript"></script>
    <%--限定特定範圍的數字--%>
    <script src="scripts/jquery.jstepper.js" type="text/javascript"></script>

    <%--for jquery-spin.js--%>
    <script src="scripts/jquery-ui.min.js" type="text/javascript"></script>
    <%--使用spin-button選取數字--%>
    <script src="scripts/jquery-spin.js" type="text/javascript"></script>
    
    

    <script src="scripts/validator.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    
    <%--數字--%>
    <asp:Panel GroupingText="數字" CssClass="group" runat="server">
        <asp:TextBox hint="浮點數" CssClass="numeric" runat="server" />
        <asp:TextBox hint="整數" CssClass="integer" runat="server" />
        <asp:TextBox hint="正整數" CssClass="positive-integer" runat="server" />
        <hr />
        
        <asp:TextBox hint="浮點數[限定範圍 -10.5 ~ 10.5]" CssClass="numeric min_n10d5 max_10d5" runat="server" />
        <asp:TextBox hint="整數  [限定範圍 -10   ~ 10  ]" CssClass="integer min_n10 max_10" runat="server" />
        <asp:TextBox hint="正整數[限定範圍   5   ~ 10  ]" CssClass="positive_integer min_5 max_10" runat="server" />
        <hr />
        
        <%--spin不能與Watermark一起用--%>
        <asp:TextBox CssClass="spin numeric min_n10d5 max_10d5 interval0d1_min_n10d5_max_10d5" runat="server" />
        <asp:TextBox CssClass="spin integer min_n10 max_10 interval2_min_n10_max_10" runat="server" />
        <asp:TextBox CssClass="spin positive_integer min_5 max_10 interval1_min_5_max_10" runat="server" />
    </asp:Panel>
    
    <asp:Panel ID="Panel1" GroupingText="驗證" CssClass="group" runat="server">
        <asp:TextBox ID="Validation1" hint="ip [e.g. 127.0.0.1]" runat="server" />
        <asp:CustomValidator 
            ControlToValidate="Validation1"
            ClientValidationFunction="validator.ip"
            ID="Validator_ip" 
            runat="server" 
            Display="Dynamic" 
            ValidationGroup="Validation" />
        
        <asp:TextBox ID="Validation2" hint="id [e.g. A123456789]" runat="server" />
        <asp:CustomValidator 
            ControlToValidate="Validation2"
            ClientValidationFunction="validator.id"
            ID="Validator_id" 
            runat="server" 
            Display="Dynamic" 
            ValidationGroup="Validation" />
        
        <asp:TextBox ID="Validation3" hint="email [e.g. a@b.c]" runat="server" />
        <asp:CustomValidator 
            ControlToValidate="Validation3"
            ClientValidationFunction="validator.email"
            ID="Validator_email" 
            runat="server" 
            Display="Dynamic" 
            ValidationGroup="Validation" />
         
        <asp:TextBox ID="Validation4" hint="url [e.g. www.google.com]" runat="server" />
        <asp:CustomValidator 
            ControlToValidate="Validation4"
            ClientValidationFunction="validator.url"
            ID="Validator_url" 
            runat="server" 
            Display="Dynamic" 
            ValidationGroup="Validation" />
               
        <hr />
        <asp:Button 
            ID="BtnValidate" 
            runat="server" 
            Text="Validate" 
            ValidationGroup="Validation" />
    </asp:Panel>
    
    </form>
    
    <script src="scripts/demoTextBox.js" type="text/javascript"></script>
</body>
</html>
